<template>
  <div class="today_box">
    <!-- 今日工单提示 -->
    <div v-if="remindlist.length > 0">
      <div class="today" v-for="(item,index) in remindlist" :key="index">
        <div>
          <p>{{item.title}}</p>
          <p>{{item.area}} | {{ item.cate_name }}</p>
          <p>详情 >></p>
        </div>
        <div>时间：{{item.add_timer}}</div>
        <div>
          <div>
            <img :src="item.avatar" alt="" />
            <p>{{item.nickname}}</p>
          </div>
          <p>{{item.address}}</p>
          <p>{{item.timeTran}}</p>
        </div>
      </div>
    </div>
    <div class="tishi" v-else>今日暂无工单</div>
  </div>
</template>

<script>
export default {
  props: {},
  data() {
    return {
      remindlist: []
    }
  },
  onShow() {

    let mobile =  wx.getStorageSync("mobile")
    this.request({
      url: this.baseUrl + '/api/edit/waterUser',
      data:{
        type: 1,
        mobile: mobile
      },
      method: 'POST',
    })
    .then(result=>{
			if(result.status == 200){
        this.user = result.data.user_login
        this.request({
          url: this.baseUrl + '/api/wechatapp/worktoday',
          data:{
            water_user_id: this.user.id
          },
          method: 'GET',
        })
        .then(result=>{
          if(result.status == 200){
            this.remindlist = result.data
          } else {
            return false
          }
        })

			} else {
        wx.reLaunch({
          url: '../login/main'
        })
        return false
			}
    })

  },
  computed: {},
  created() {},
  mounted() {},
  watch: {},
  methods: {},
  components: {},
};
</script>

<style scoped >
.today {
  margin: 20rpx;
  padding: 30rpx;
  background: #ffffff;
  border-radius: 8rpx;
}
.today > div:nth-child(1) {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.today > div:nth-child(1) > p:nth-child(3) {
  color: #999999;
  font-size: 26rpx;
}
.today > div:nth-child(2) {
  padding: 30rpx 0;
  border-bottom: 2rpx solid #f5f5f5;
  color: #444444;
  font-size: 26rpx;
}
.today > div:nth-child(3) img {
  width: 48rpx;
  height: 48rpx;
  background: chocolate;
}
.today > div:nth-child(3) {
  margin-top: 30rpx;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #999999;
}
.today > div:nth-child(3) > div:nth-child(1) {
  display: flex;
  align-items: center;
}
.today > div:nth-child(3) > div:nth-child(1) p {
  margin-left: 20rpx;
}
.today > div:nth-child(3) > p:nth-child(3) {
  font-size: 26rpx;
}
.today > div:nth-child(3) > p:nth-child(2) {
  margin-right: 40rpx;
}
.today > div:nth-child(1) > p:nth-child(2) {
  margin-right: 70rpx;
}
</style>
